const sequelize = require("../db");
const { DataTypes } = require("sequelize");
const MessageModel = sequelize.define("Message", {
    nickname: {
        type: DataTypes.STRING,
        allowNull: false
    },
    content: {
        type: DataTypes.STRING,
        allowNull: false
    },
    avatar: {
        type: DataTypes.STRING,
        allowNull: false
    },
    createDate: {
        type: DataTypes.STRING,
        allowNull: false
    },
}, {
    createdAt: false,
    updatedAt: false,
    paranoid: true
})

/**
 * nickname": "秀儿",
        "content": "这篇文章不错！",
        "createDate": 1619946440211, // 创建日期
        "avatar": "/static/avatar/666.png", // 头像地址
        "id": "608e6bc8bc3f907a80e87da4", 
        "blog": {
            "title": "vue响应式原理",
            "id": "6086909cfd71d01dbb7bae0e"
        }
 */
module.exports = MessageModel;